//
//  WebPageViewController.m
//  TheBankPro
//
//  Created by 杜文杰 on 2017/9/7.
//  Copyright © 2017年 dwj. All rights reserved.
//

#import "WebPageViewController.h"
#import <WebKit/WebKit.h>

@interface WebPageViewController ()<WKNavigationDelegate,WKUIDelegate>
@property (nonatomic, strong) WKWebView *wkWebView;
@end

@implementation WebPageViewController
- (void)setDataDic:(NSDictionary *)dataDic
{
    if (dataDic[@"url"] > 0) {
//        [self.wkWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:webPageUrlStr]]];
        [self.wkWebView loadHTMLString:dataDic[@"url"] baseURL:nil];
    }
    if (dataDic[@"articletitle"] > 0) {
        self.title = dataDic[@"articletitle"];
    }
}
- (void)viewDidLoad {
    [super viewDidLoad];
    [self.view addSubview:self.wkWebView];
}
- (WKWebView *)wkWebView
{
    if (!_wkWebView) {
        _wkWebView = [[WKWebView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT - 48)];
        _wkWebView.navigationDelegate = self;
        _wkWebView.UIDelegate = self;
    }
    return _wkWebView;
}
@end
